﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Drawing;
using System.Threading;
using System.Globalization;

public partial class AllInternals : System.Web.UI.Page
{
    public string cid;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            GridView1.DataSource = CusSqlDataSource;
            GridView1.DataBind();
           
        }
    }
    protected override void InitializeCulture()
    {
        if (Session["CurrentCulture"] != null)
        {
            string lang = Session["CurrentCulture"].ToString();
            if (lang != null && lang != "")
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);


            }
        }

    }
   
   
    
   
    protected void delete_Click(object sender, EventArgs e)
    {
        LinkButton lk= ((LinkButton)sender);
        string myid =lk.ToolTip;
        if (int.Parse(myid) == 0)
        {

            DB.DELETE("internal_distribution", "int,id," + lk.CommandArgument);
            DB.DELETE("internal_copies", "int,internal_id," + lk.CommandArgument);
            DB.DELETE("internal_checking", "int,internal_id," + lk.CommandArgument);
        }
        foreach (GridViewRow row in GridView1.Rows)
        {
            row.BackColor = System.Drawing.Color.Empty;
        }
        GridView1.DataSource = CusSqlDataSource;
        GridView1.DataBind();
     

    }
    
   
    
    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        //if (e.Row.RowType == DataControlRowType.DataRow)
        //{
        //    e.Row.Attributes.Add("onmouseover", "this.Mystyle=this.style.backgroundColor;this.style.backgroundColor='#FFFFA8'");

        //    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.Mystyle");
        //}
    }





}
